package com.at.abc.r419_e;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class d {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solve();
        out.flush();
        out.close();
        br.close();
    }

    static void solve() throws IOException {
        String[] ss = br.readLine().split(" ");
        int n = Integer.parseInt(ss[0]);
        int m = Integer.parseInt(ss[1]);
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int[] diff = new int[n + 1];
        for (int i = 0; i < m; i++) {
            ss = br.readLine().split(" ");
            int l = Integer.parseInt(ss[0]) - 1;
            int r = Integer.parseInt(ss[1]) - 1;
            diff[l] += 1;
            diff[r + 1] -= 1;
        }

        StringBuilder ans = new StringBuilder(n);
        int cur = 0;
        for (int i = 0; i < n; i++) {
            cur += diff[i];
            if ((cur & 1) == 0) ans.append(s[i]);
            else ans.append(t[i]);
        }

        System.out.println(ans.toString());
    }
}
